<?
include_once("map/submitTroughImage.class.php");
$sti = new submitTroughImage();
if($sti->checkPost() === true)
{
	$txt_username 	= strip_tags(trim(addslashes($_POST["txt_username"])));
	$txt_password 	= $_POST["txt_password"];
	$txt_email 		= strip_tags($_POST["txt_email"]);
	
	$id_check = get_sql("SELECT id FROM user WHERE username LIKE '".$txt_username."'") + 0;
	
	$user = new User();
	$user->select($id_check);
	
	if ($txt_password != "")
	{
		$user->setpassword(md5($txt_password.$txt_username));
		$_SESSION['member_password'] = md5($txt_password.$txt_username);
	}
	$user->setemail($txt_email);
	$user->setphone_number($txt_phone_number);
	$user->setname($txt_name);
	$user->setaddress($txt_address);
	$user->setupdated_at(date("Y-m-d"));
	
	$user->update();
	if ($user) 
		echo "OK-Thay đổi thông tin thành công. ";

}
else
	echo "FAIL-Mã xác nhận chưa đúng";
?>